package dk.itu.spvc.tourtracker.model;

import java.util.Observable;

public class CurrentState extends Observable {

	public final static int VIEW = 0;
	public final static int RECORD = 1;
	public final static int PAUSED = 2;
	
	private int tripId;
	private int state;	

	public CurrentState(int tripId, int state) {
		this.tripId = tripId;
		this.state = state;
	}
	
	public void setTripId(int tripId) {
		this.tripId = tripId;		
	}

	public int getTripId() {
		return tripId;
	}

	public void setState(int state) {
		this.state = state;	
		this.setChanged();
		this.notifyObservers(this);
	}

	public int getState() {
		return state;
	}	
	
	public String getNamedState() {
		switch (state){
			case VIEW:
				return "VIEW";
			case RECORD:
				return "RECORD";
			case PAUSED:
				return "PAUSED";
			default:
				return "";
		}
	}
}
